package com.tedu.bill.homework2;

/**
 * Author：毕龙
 * Date: 2024/3/28 19:17
 */
public class TestQuestion15 {
    public static void main(String[] args) {

        /**
         * A1 = 1
         * A2 = 100
         * A3 = A2-A1
         * n <= 300
         * An并输出
         * N<= 0
         */
        System.out.println(abs(-1));
    }
    /**
     * An+2 = |An+1 -An|
     */
    public static int abs(int n){
        if(n <= 0){
            return -1;
        }
        if(n== 1){
            return 1;
        }
        if(n == 2){
            return 100;
        }
        //An = |An-1 - An-2|
        return Math.abs(abs(n-1)-abs(n-2));
    }





}
